﻿namespace SomethingSpacial.AppServices.Web
{
    using System.ComponentModel.DataAnnotations;
    using SomethingSpacial.AppServices.Web.Resources;

    public sealed partial class RegistrationData
    {
        [Key]
        [Required(ErrorMessageResourceName = "ValidationErrorRequiredField", ErrorMessageResourceType = typeof(ErrorResources))]
        [Display(Order = 0, Name = "UserNameLabel", ResourceType = typeof(RegistrationDataResources))]
        [RegularExpression("^[a-zA-Z0-9_]*$", ErrorMessageResourceName = "ValidationErrorInvalidUserName", ErrorMessageResourceType = typeof(ErrorResources))]
        public string UserName { get; set; }

        [Key]
        [Required(ErrorMessageResourceName = "ValidationErrorRequiredField", ErrorMessageResourceType = typeof(ErrorResources))]
        [Display(Order = 2, Name = "EmailLabel", ResourceType = typeof(RegistrationDataResources))]
        [RegularExpression(@"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$",
                           ErrorMessageResourceName = "ValidationErrorInvalidEmail", ErrorMessageResourceType = typeof(ErrorResources))]
        public string Email { get; set; }

        [Required(ErrorMessageResourceName = "ValidationErrorRequiredField", ErrorMessageResourceType = typeof(ErrorResources))]
        [Display(Order = 3, Name = "PasswordLabel", Description = "PasswordDescription", ResourceType = typeof(RegistrationDataResources))]
        [RegularExpression("^.*[^a-zA-Z0-9].*$", ErrorMessageResourceName = "ValidationErrorBadPasswordStrength", ErrorMessageResourceType = typeof(ErrorResources))]
        [StringLength(50, MinimumLength = 7, ErrorMessageResourceName = "ValidationErrorBadPasswordLength", ErrorMessageResourceType = typeof(ErrorResources))]
        public string Password { get; set; }

        [Display(Order = 1, Name = "FriendlyNameLabel", Description = "FriendlyNameDescription", ResourceType = typeof(RegistrationDataResources))]
        public string FriendlyName { get; set; }

        [Required(ErrorMessageResourceName = "ValidationErrorRequiredField", ErrorMessageResourceType = typeof(ErrorResources))]
        [Display(Order = 5, Name = "SecurityQuestionLabel", ResourceType = typeof(RegistrationDataResources))]
        public string Question { get; set; }

        [Required(ErrorMessageResourceName = "ValidationErrorRequiredField", ErrorMessageResourceType = typeof(ErrorResources))]
        [Display(Order = 6, Name = "SecurityAnswerLabel", ResourceType = typeof(RegistrationDataResources))]
        public string Answer { get; set; }

        [Display(Order = 7, Name = "WebsiteLabel", Description = "WebsiteDescription", ResourceType = typeof(RegistrationDataResources))]
        public string Website { get; set; }

        [Display(Order = 8, Name = "AddressLabel", Description = "AddressDescription", ResourceType = typeof(RegistrationDataResources))]
        public string Address { get; set; }

        [Display(Order = 9, Name = "CityLabel", Description = "CityDescription", ResourceType = typeof(RegistrationDataResources))]
        public string City { get; set; }

        [Display(Order = 10, Name = "StateLabel", Description = "StateDescription", ResourceType = typeof(RegistrationDataResources))]
        public string State { get; set; }

        [Display(Order = 11, Name = "ZipCodeLabel", Description = "ZipCodeDescription", ResourceType = typeof(RegistrationDataResources))]
        public string ZipCode { get; set; }

        [Display(Order = 12, Name = "BioLabel", Description = "BioDescription", ResourceType = typeof(RegistrationDataResources))]
        public string Bio { get; set; }

        [Display(Order = 13, Name = "PhotoUrlLabel", Description = "PhotoUrlDescription", ResourceType = typeof(RegistrationDataResources))]
        public string PhotoUrl { get; set; }

        [Display(Order = 14, Name = "TwitterIDLabel", Description = "TwitterIDDescription", ResourceType = typeof(RegistrationDataResources))]
        public string TwitterID { get; set; }

        [Display(Order = 15, Name = "FacebookIDLabel", Description = "FacebookIDDescription", ResourceType = typeof(RegistrationDataResources))]
        public string FacebookID { get; set; }

        [Display(Order = 16, Name = "LinkedInIDLabel", Description = "LinkedInIDDescription", ResourceType = typeof(RegistrationDataResources))]
        public string LinkedInID { get; set; }

        
    }
}
